package com.zzxy.mybatis.test;


import com.zzxy.mybatis.dao.IUserDao;
import com.zzxy.mybatis.entity.User;
import com.zzxy.mybatis.mapper.OrderMapper;
import com.zzxy.mybatis.mapper.UserMapper;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class testMybatis_spring {
    @Test
    public void test05(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        IUserDao userDao = (IUserDao) context.getBean("userDao");
        User user = userDao.findUserById2(43);
        System.out.println(user);
    }

    @Test
    public void test06(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserMapper usermapper = (UserMapper) context.getBean("userMapper");
        System.out.println(usermapper.findUserById(10));
    }




}
